home *** CD-ROM | disk | FTP | other *** search
/ SGI Enlighten DSM 1.1 / SGI EnlightenDSM 1.1.iso / aix41 / flexlm.z / flexlm / FLEXlm / stop_dsmld < prev   
Text File  |  1998-06-30  |  1KB  |  63 lines

  1. #!/bin/sh
  2. #
  3. # Script: stop_dsmld
  4. #
  5. # stop_dsmld stops Enlighten license daemons lmgrd and dsmld 
  6. #
  7. # Note: I tried to use $* to pass "$procs" around, but
  8. # SCO fails to deal with $* properly in the context of a function.
  9. # Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
  10. # All Rights Reserved.
  11. #
  12.  
  13. PATH=/bin:/usr/bin:/etc:/usr/ucb:/usr/bsd:/usr/etc:$PATH
  14. export PATH
  15. appName="stop_dsmld"
  16.  
  17. #
  18. # Get emd directory
  19. #
  20.  
  21. emd_dir=`egrep "^emd_dir=" /etc/enlighten | cut "-d=" -f2-`
  22. if [ -z "$emd_dir" -o ! -d "$emd_dir" ] ; then
  23.     echo "$appName: Unable to determine FLEXlm directory."
  24.     echo "$appName: Unable to stop daemons."
  25.     exit 1
  26. else
  27.     flex_dir="${emd_dir}/FLEXlm"
  28.     if [ ! -x ${flex_dir}/lmutil ] ; then
  29.         echo "$appName: Unable to find lmutil."
  30.         echo "$appName: Unable to stop daemons."
  31.         exit 1
  32.     fi
  33. fi
  34.  
  35. lic_file="${flex_dir}/license.dat"
  36. dsmld="dsmld"
  37.  
  38. #
  39. # Bring the daemons down
  40. #
  41.  
  42. ${flex_dir}/lmutil lmdown -c ${flex_dir}/license.dat -q
  43.     
  44.         
  45. #
  46. # see if they are still up
  47. #
  48.  
  49. # we need to match both a hostname and an IP address
  50. lmgrdstat=`${flex_dir}/lmutil lmstat -c $lic_file | egrep "^ *[a-zA-Z]*[0-9.]*: license server" | awk '{print $4}'`
  51.  
  52. dsmldstat=`${flex_dir}/lmutil lmstat -c $lic_file | egrep "^ *$dsmld" | awk '{print $2}'`
  53.  
  54. if [ "$lmgrdstat" = "UP" -o "$dsmldstat" = "UP" ] ;  then
  55.     echo "$app_name: License daemons failed to stop."
  56.     echo "$app_name: See $log_file for details." 
  57.     exit 1
  58. fi
  59.  
  60. echo "$appName: Finished."
  61. exit 0
  62.